import { Queue } from '@/lib/Queue';

interface INode {
  id: String;
  deep: Number;
  childs?: INode[];

  value: Object;
  option: Object;
  lastChangeTime: Number;
}

let lastUpdateDomTime = 0;

const diff = (parentNode: INode) => {
  
  const queue = new Queue<INode>();
  queue.enqueue(parentNode);

  while(queue.size() > 0) {
    let nowNode = queue.dequeue()!;

    nowNode.childs?.forEach(child => queue.enqueue(child));

    if ( nowNode.lastChangeTime > lastUpdateDomTime ) {
      // 更新DOM
    }
  }
  
}


for(let i = 0 ; i< 10 ; ++i) {
  console.log(i)
}

const f = (i: number) => {
  if ( i < 10 ) {
    console.log(i);
    f(i+1)
  } 
}
f(0)